import { createApp } from 'vue'
import App from './App.vue'
import router  from '@/router/index'
// import './style.css'

//引入element-plus组件库
import  ElementPlus  from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import  zhCn  from 'element-plus/es/locale/lang/zh-cn'//引用页数中文
import piniaPersist from 'pinia-plugin-persist'
import myConfirm from './utils/myConfirm'
//引入Pinia函数
import { createPinia } from 'pinia'
//实例化Pinia
const pinia = createPinia()
pinia.use(piniaPersist)
// createApp(App).mount('#app')
const app= createApp(App);
app.use(ElementPlus,{ locale:zhCn ,}).use(router).use(pinia).mount('#app')
//注册全局图标组件
for (const [key,component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key,component)
}
//全局注册
app.config.globalProperties.$myconfirm = myConfirm